package net.common.db;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;

/**
 * 存储过程的实现类
 * 
 */
public class CallableStatementWrapper extends PreparedStatementWrapper implements CallableStatement {

	private CallableStatement stmt = null;

	public CallableStatementWrapper(PreparedStatement stmt, ConnectionWrapper conn, String sql) {
		super(stmt, conn, sql);
		this.sql = sql;
		stmt = (CallableStatement) stmt;
	}

	public Array getArray(int parameterIndex) throws SQLException {
		return stmt.getArray(parameterIndex);
	}

	public Array getArray(String parameterName) throws SQLException {
		return stmt.getArray(parameterName);
	}

	public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
		return stmt.getBigDecimal(parameterIndex);
	}

	public BigDecimal getBigDecimal(String parameterName) throws SQLException {
		return stmt.getBigDecimal(parameterName);
	}

	@SuppressWarnings("deprecation")
	public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException {
		return stmt.getBigDecimal(parameterIndex, scale);
	}

	public Blob getBlob(int parameterIndex) throws SQLException {
		return stmt.getBlob(parameterIndex);
	}

	public Blob getBlob(String parameterName) throws SQLException {
		return stmt.getBlob(parameterName);
	}

	public boolean getBoolean(int parameterIndex) throws SQLException {
		return stmt.getBoolean(parameterIndex);
	}

	public boolean getBoolean(String parameterName) throws SQLException {
		return stmt.getBoolean(parameterName);
	}

	public byte getByte(int parameterIndex) throws SQLException {
		return stmt.getByte(parameterIndex);
	}

	public byte getByte(String parameterName) throws SQLException {
		return stmt.getByte(parameterName);
	}

	public byte[] getBytes(int parameterIndex) throws SQLException {
		return stmt.getBytes(parameterIndex);
	}

	public byte[] getBytes(String parameterName) throws SQLException {
		return stmt.getBytes(parameterName);
	}

	public Reader getCharacterStream(int parameterIndex) throws SQLException {
		return stmt.getCharacterStream(parameterIndex);
	}

	public Reader getCharacterStream(String parameterName) throws SQLException {
		return stmt.getCharacterStream(parameterName);
	}

	public Clob getClob(int parameterIndex) throws SQLException {
		return stmt.getClob(parameterIndex);
	}

	public Clob getClob(String parameterName) throws SQLException {
		return stmt.getClob(parameterName);
	}

	public Date getDate(int parameterIndex) throws SQLException {
		return stmt.getDate(parameterIndex);
	}

	public Date getDate(String parameterName) throws SQLException {
		return stmt.getDate(parameterName);
	}

	public Date getDate(int parameterIndex, Calendar cal) throws SQLException {
		return stmt.getDate(parameterIndex, cal);
	}

	public Date getDate(String parameterName, Calendar cal) throws SQLException {
		return stmt.getDate(parameterName, cal);
	}

	public double getDouble(int parameterIndex) throws SQLException {
		return stmt.getDouble(parameterIndex);
	}

	public double getDouble(String parameterName) throws SQLException {
		return stmt.getDouble(parameterName);
	}

	public float getFloat(int parameterIndex) throws SQLException {
		return stmt.getFloat(parameterIndex);
	}

	public float getFloat(String parameterName) throws SQLException {
		return stmt.getFloat(parameterName);
	}

	public int getInt(int parameterIndex) throws SQLException {
		return stmt.getInt(parameterIndex);
	}

	public int getInt(String parameterName) throws SQLException {
		return stmt.getInt(parameterName);
	}

	public long getLong(int parameterIndex) throws SQLException {
		return stmt.getLong(parameterIndex);
	}

	public long getLong(String parameterName) throws SQLException {
		return stmt.getLong(parameterName);
	}

	public Reader getNCharacterStream(int parameterIndex) throws SQLException {
		return stmt.getNCharacterStream(parameterIndex);
	}

	public Reader getNCharacterStream(String parameterName) throws SQLException {
		return stmt.getNCharacterStream(parameterName);
	}

	public NClob getNClob(int parameterIndex) throws SQLException {
		return stmt.getNClob(parameterIndex);
	}

	public NClob getNClob(String parameterName) throws SQLException {
		return stmt.getNClob(parameterName);
	}

	public String getNString(int parameterIndex) throws SQLException {
		return stmt.getNString(parameterIndex);
	}

	public String getNString(String parameterName) throws SQLException {
		return stmt.getNString(parameterName);
	}

	public Object getObject(int parameterIndex) throws SQLException {
		return stmt.getObject(parameterIndex);
	}

	public Object getObject(String parameterName) throws SQLException {
		return stmt.getObject(parameterName);
	}

	public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException {
		return stmt.getObject(parameterIndex, map);
	}

	public Object getObject(String parameterName, Map<String, Class<?>> map) throws SQLException {
		return stmt.getObject(parameterName, map);
	}

	public Ref getRef(int parameterIndex) throws SQLException {
		return stmt.getRef(parameterIndex);
	}

	public Ref getRef(String parameterName) throws SQLException {
		return stmt.getRef(parameterName);
	}

	public RowId getRowId(int parameterIndex) throws SQLException {
		return stmt.getRowId(parameterIndex);
	}

	public RowId getRowId(String parameterName) throws SQLException {
		return stmt.getRowId(parameterName);
	}

	public SQLXML getSQLXML(int parameterIndex) throws SQLException {
		return stmt.getSQLXML(parameterIndex);
	}

	public SQLXML getSQLXML(String parameterName) throws SQLException {
		return stmt.getSQLXML(parameterName);
	}

	public short getShort(int parameterIndex) throws SQLException {
		return stmt.getShort(parameterIndex);
	}

	public short getShort(String parameterName) throws SQLException {
		return stmt.getShort(parameterName);
	}

	public String getString(int parameterIndex) throws SQLException {
		return stmt.getString(parameterIndex);
	}

	public String getString(String parameterName) throws SQLException {
		return stmt.getString(parameterName);
	}

	public Time getTime(int parameterIndex) throws SQLException {
		return stmt.getTime(parameterIndex);
	}

	public Time getTime(String parameterName) throws SQLException {
		return stmt.getTime(parameterName);
	}

	public Time getTime(int parameterIndex, Calendar cal) throws SQLException {
		return stmt.getTime(parameterIndex, cal);
	}

	public Time getTime(String parameterName, Calendar cal) throws SQLException {
		return stmt.getTime(parameterName, cal);
	}

	public Timestamp getTimestamp(int parameterIndex) throws SQLException {
		return stmt.getTimestamp(parameterIndex);
	}

	public Timestamp getTimestamp(String parameterName) throws SQLException {
		return stmt.getTimestamp(parameterName);
	}

	public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException {
		return stmt.getTimestamp(parameterIndex, cal);
	}

	public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {
		return stmt.getTimestamp(parameterName, cal);
	}

	public URL getURL(int parameterIndex) throws SQLException {
		return stmt.getURL(parameterIndex);
	}

	public URL getURL(String parameterName) throws SQLException {
		return stmt.getURL(parameterName);
	}

	public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException {
		params[parameterIndex - 1] = new Integer(sqlType);
		setParamCount(parameterIndex);
		((CallableStatement) stmt).registerOutParameter(parameterIndex, sqlType);
	}

	public void registerOutParameter(String parameterName, int sqlType) throws SQLException {

	}

	public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException {
		params[parameterIndex - 1] = new Integer(sqlType);
		setParamCount(parameterIndex);
		((CallableStatement) stmt).registerOutParameter(parameterIndex, sqlType, scale);
	}

	public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException {
		params[parameterIndex - 1] = new Integer(sqlType);
		setParamCount(parameterIndex);
		((CallableStatement) stmt).registerOutParameter(parameterIndex, sqlType, typeName);
	}

	public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException {

	}

	public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException {

	}

	public void setAsciiStream(String parameterName, InputStream x) throws SQLException {

	}

	public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {

	}

	public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException {

	}

	public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {

	}

	public void setBinaryStream(String parameterName, InputStream x) throws SQLException {

	}

	public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {

	}

	public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException {

	}

	public void setBlob(String parameterName, Blob x) throws SQLException {

	}

	public void setBlob(String parameterName, InputStream inputStream) throws SQLException {

	}

	public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {

	}

	public void setBoolean(String parameterName, boolean x) throws SQLException {

	}

	public void setByte(String parameterName, byte x) throws SQLException {

	}

	public void setBytes(String parameterName, byte[] x) throws SQLException {

	}

	public void setCharacterStream(String parameterName, Reader reader) throws SQLException {

	}

	public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {

	}

	public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {

	}

	public void setClob(String parameterName, Clob x) throws SQLException {

	}

	public void setClob(String parameterName, Reader reader) throws SQLException {

	}

	public void setClob(String parameterName, Reader reader, long length) throws SQLException {

	}

	public void setDate(String parameterName, Date x) throws SQLException {

	}

	public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {

	}

	public void setDouble(String parameterName, double x) throws SQLException {

	}

	public void setFloat(String parameterName, float x) throws SQLException {

	}

	public void setInt(String parameterName, int x) throws SQLException {

	}

	public void setLong(String parameterName, long x) throws SQLException {

	}

	public void setNCharacterStream(String parameterName, Reader value) throws SQLException {

	}

	public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {

	}

	public void setNClob(String parameterName, NClob value) throws SQLException {

	}

	public void setNClob(String parameterName, Reader reader) throws SQLException {

	}

	public void setNClob(String parameterName, Reader reader, long length) throws SQLException {

	}

	public void setNString(String parameterName, String value) throws SQLException {

	}

	public void setNull(String parameterName, int sqlType) throws SQLException {

	}

	public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {

	}

	public void setObject(String parameterName, Object x) throws SQLException {

	}

	public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {

	}

	public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {

	}

	public void setRowId(String parameterName, RowId x) throws SQLException {

	}

	public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {

	}

	public void setShort(String parameterName, short x) throws SQLException {

	}

	public void setString(String parameterName, String x) throws SQLException {

	}

	public void setTime(String parameterName, Time x) throws SQLException {

	}

	public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {

	}

	public void setTimestamp(String parameterName, Timestamp x) throws SQLException {

	}

	public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {

	}

	public void setURL(String parameterName, URL val) throws SQLException {

	}

	@Override
	public void addBatch() throws SQLException {

	}

	@Override
	public void clearParameters() throws SQLException {
		for (int i = 0; i < params.length; i++) {
			params[i] = null;
		}
		nParams = 0;
		((CallableStatement) stmt).clearParameters();
	}

	@Override
	public boolean execute() throws SQLException {
		return ((CallableStatement) stmt).execute();
	}

	@Override
	public ResultSet executeQuery() throws SQLException {
		return ((CallableStatement) stmt).executeQuery();
	}

	@Override
	public int executeUpdate() throws SQLException {
		return ((CallableStatement) stmt).executeUpdate();
	}

	@Override
	public ResultSetMetaData getMetaData() throws SQLException {
		return ((CallableStatement) stmt).getMetaData();
	}

	@Override
	public ParameterMetaData getParameterMetaData() throws SQLException {
		return ((CallableStatement) stmt).getParameterMetaData();
	}

	@Override
	public void setArray(int parameterIndex, Array x) throws SQLException {
		
	}

	@Override
	public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
		
	}

	@Override
	public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
		
	}

	@Override
	public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
		
	}

	@Override
	public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
		
	}

	@Override
	public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
		
	}

	@Override
	public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
		
	}

	@Override
	public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
		
	}

	@Override
	public void setBlob(int parameterIndex, Blob x) throws SQLException {
		
	}

	@Override
	public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
		
	}

	@Override
	public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
		
	}

	@Override
	public void setBoolean(int parameterIndex, boolean x) throws SQLException {
		
	}

	@Override
	public void setByte(int parameterIndex, byte x) throws SQLException {
		
	}

	@Override
	public void setBytes(int parameterIndex, byte[] x) throws SQLException {
		
	}

	@Override
	public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
		
	}

	@Override
	public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
		
	}

	@Override
	public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
		
	}

	@Override
	public void setClob(int parameterIndex, Clob x) throws SQLException {
		
	}

	@Override
	public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
		
	}

	@Override
	public void setClob(int parameterIndex, Reader reader) throws SQLException {
		
	}

	@Override
	public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
		
	}

	@Override
	public void setDate(int parameterIndex, Date x) throws SQLException {
	
	}

	@Override
	public void setDouble(int parameterIndex, double x) throws SQLException {
		
	}

	@Override
	public void setFloat(int parameterIndex, float x) throws SQLException {
		
	}

	@Override
	public void setInt(int parameterIndex, int x) throws SQLException {
		
	}

	@Override
	public void setLong(int parameterIndex, long x) throws SQLException {
		
	}

	@Override
	public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
		
	}

	@Override
	public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
		
	}

	@Override
	public void setNClob(int parameterIndex, NClob value) throws SQLException {
		
	}

	@Override
	public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
	
	}

	@Override
	public void setNClob(int parameterIndex, Reader reader) throws SQLException {
		
	}

	@Override
	public void setNString(int parameterIndex, String value) throws SQLException {
		
	}

	@Override
	public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException {
		
	}

	@Override
	public void setNull(int parameterIndex, int sqlType) throws SQLException {
	
	}

	@Override
	public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
	
	}

	@Override
	public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
		
	}

	@Override
	public void setObject(int parameterIndex, Object x) throws SQLException {
		
	}

	@Override
	protected void setParamCount(int parameterIndex) {
		
	}

	@Override
	public void setRef(int parameterIndex, Ref x) throws SQLException {
		
	}

	@Override
	public void setRowId(int parameterIndex, RowId x) throws SQLException {
	
	}

	@Override
	public void setShort(int parameterIndex, short x) throws SQLException {
	
	}

	@Override
	public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
		
	}

	@Override
	public void setString(int parameterIndex, String x) throws SQLException {
	
	}

	@Override
	public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
	
	}

	@Override
	public void setTime(int parameterIndex, Time x) throws SQLException {
		
	}

	@Override
	public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
		
	}

	@Override
	public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
		
	}

	@Override
	public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
		
	}

	@Override
	public void setURL(int parameterIndex, URL x) throws SQLException {
		
	}

	@Override
	public void addBatch(String sql) throws SQLException {
	}

	@Override
	public void cancel() throws SQLException {
		stmt.cancel();
	}

	@Override
	public void clearBatch() throws SQLException {

		stmt.clearBatch();
	}

	@Override
	public void clearWarnings() throws SQLException {
		stmt.clearWarnings();
	}

	@Override
	public void close() throws SQLException {
		stmt.close();
		conn.statement.remove(this);
	}

	@Override
	public boolean execute(String sql) throws SQLException {
		return stmt.execute(sql);
	}

	@Override
	public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
		return stmt.execute(sql, autoGeneratedKeys);
	}

	@Override
	public boolean execute(String sql, int[] columnIndexes) throws SQLException {
		return stmt.execute(sql, columnIndexes);
	}

	@Override
	public boolean execute(String sql, String[] columnNames) throws SQLException {
		return stmt.execute(sql, columnNames);
	}

	@Override
	public int[] executeBatch() throws SQLException {
		return stmt.executeBatch();
	}

	@Override
	public ResultSet executeQuery(String sql) throws SQLException {
		return stmt.executeQuery(sql);
	}

	@Override
	public int executeUpdate(String sql) throws SQLException {
		return stmt.executeUpdate(sql);
	}

	@Override
	public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
		return stmt.executeUpdate(sql, autoGeneratedKeys);
	}

	@Override
	public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
		return stmt.executeUpdate(sql, columnIndexes);
	}

	@Override
	public int executeUpdate(String sql, String[] columnNames) throws SQLException {
		return stmt.executeUpdate(sql, columnNames);
	}

	@Override
	protected String getClassName() {
		return "CallableStatementWrapper";
	}

	@Override
	public Connection getConnection() throws SQLException {
		return stmt.getConnection();
	}

	@Override
	public int getFetchDirection() throws SQLException {
		return stmt.getFetchDirection();
	}

	@Override
	public int getFetchSize() throws SQLException {
		return stmt.getFetchSize();
	}

	@Override
	public ResultSet getGeneratedKeys() throws SQLException {
		return stmt.getGeneratedKeys();
	}

	@Override
	public int getMaxFieldSize() throws SQLException {
		return stmt.getMaxFieldSize();
	}

	@Override
	public int getMaxRows() throws SQLException {
		return stmt.getMaxRows();
	}

	@Override
	public boolean getMoreResults() throws SQLException {
		return stmt.getMoreResults();
	}

	@Override
	public boolean getMoreResults(int current) throws SQLException {
		return stmt.getMoreResults(current);
	}

	@Override
	public int getQueryTimeout() throws SQLException {
		return stmt.getQueryTimeout();
	}

	@Override
	public ResultSet getResultSet() throws SQLException {
		return stmt.getResultSet();
	}

	@Override
	public int getResultSetConcurrency() throws SQLException {
		return stmt.getResultSetConcurrency();
	}

	@Override
	public int getResultSetHoldability() throws SQLException {
		return stmt.getResultSetHoldability();
	}

	@Override
	public int getResultSetType() throws SQLException {
		return stmt.getResultSetType();
	}

	@Override
	public int getUpdateCount() throws SQLException {
		return stmt.getUpdateCount();
	}

	@Override
	public SQLWarning getWarnings() throws SQLException {
		return stmt.getWarnings();
	}

	@Override
	public boolean isClosed() throws SQLException {
		return stmt.isClosed();
	}

	@Override
	public boolean isPoolable() throws SQLException {
		return stmt.isPoolable();
	}

	@Override
	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return stmt.isWrapperFor(iface);
	}

	@Override
	public void setCursorName(String name) throws SQLException {
		stmt.setCursorName(name);
	}

	@Override
	public void setEscapeProcessing(boolean enable) throws SQLException {
		stmt.setEscapeProcessing(enable);
	}

	@Override
	public void setFetchDirection(int direction) throws SQLException {
		stmt.setFetchDirection(direction);
	}

	@Override
	public void setFetchSize(int rows) throws SQLException {
		stmt.setFetchSize(rows);
	}

	@Override
	public void setMaxFieldSize(int max) throws SQLException {
		stmt.setMaxFieldSize(max);
	}

	@Override
	public void setMaxRows(int max) throws SQLException {
		stmt.setMaxRows(max);
	}

	@Override
	public void setPoolable(boolean poolable) throws SQLException {
		stmt.setPoolable(poolable);
	}

	@Override
	public void setQueryTimeout(int seconds) throws SQLException {
		stmt.setQueryTimeout(seconds);
	}

	@Override
	public <T> T unwrap(Class<T> iface) throws SQLException {
		return stmt.unwrap(iface);
	}

	public boolean wasNull() throws SQLException {

		return false;
	}

	@Override
	public void closeOnCompletion() throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isCloseOnCompletion() throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	public <T> T getObject(int parameterIndex, Class<T> type)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public <T> T getObject(String parameterName, Class<T> type)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

}
